import ajax from './index'
import { append } from './index'
//区域管理-省级列表
export function providerRegionProvinceList(){
   return ajax.get('/admin/service_provider_region/province/list')
}

//区域管理-区级列表
export function providerRegionAreaList(url){
   return ajax.get('/admin/service_provider_region/area/list?'+url)
}

//区域管理-社区列表
export function providerRegionVillageList(url){
  return ajax.get('/admin/service_provider_region/village/list?'+ url)
}

//获取下级地区列表
export function commonChilderRegionList(url){
  return ajax.get('/v2/common/children_region/list?'+url)
}

//区域管理-批量更新区域昵称
export function batchUpdateRegionNickname(data){
  return ajax.post('/admin/service_provider_region/batch_update_region_nickname',data)
}

//服务商订单列表
export const serviceProviderSearch = data => {
  return ajax.get(`partner_admin/service_provider/search${append(data)}`)
}

//服务商开启、禁用
export function  serviceProviderIsEnableUpdate(data){
  return ajax.post('/admin/service_provider/is_enable/update',data)
}

//编辑社区服务商
export function serviceProviderUpdate(data){
  return ajax.post('/admin/service_provider/update', data)
}

//服务商详细信息
export const serviceProviderGetInformation = (id) => {
  return ajax.get(`partner_admin/service_provider/${id}/get`)
}

//邀请服务商
export function serviceProviderInvitationSearch(url){
  return ajax.get('/admin/service_provider/been_invitation/service_provider/search?'+url)
}

//服务商粉丝
export function serviceProviderFansUidSearch(id,url){
  return ajax.get('/admin/service_provider/fans/' + id + '/search?'+url)
}

//收益明细
export function serviceIncomesUidSearch(id,url){
  return ajax.get('/admin/service_provider/incomes/'+id+'/search?'+url)
}

//创建社区服务商
export function serviceProviderCreate(data){
  return ajax.post('/admin/service_provider/create',data)
}

//过滤已认证服务商社区
export function serviceProviderFilterRegion(id){
  return ajax.get('/admin/service_provider_region/region/list?region_id='+id)
}

//服务商移除
export function servicePorviderRemove(data){
  return ajax.post('/admin/service_provider/remove',data)
}

//服务商移除列表
export function serviceProviderDeleteList(data){
  return ajax.post('/admin/service_provider/delete_list',data)
}

//服务商资质审核
export function serviceProviderToVerifySearch(url){
  return ajax.get('/admin/service_provider/to_verify/search?'+url)
}

//服务商审核
export function serviceProviderExamineUpdate(data){
  return ajax.post('/admin/service_provider/examine/update',data)
}

//审核记录列表
export function  serviceProviderVerifyRecordList(id){
  return ajax.get('/admin/service_provider/verify_record/'+id+'/list')
}

//服务商-红包充值记录
export function cardUserIncomeIdSearch(id,url){
  return ajax.get('/admin/card/user/'+id+'/income/search?'+url)
}

//服务商-发红包记录
export function serviceProviderSendRedpacket(url)
{
  return ajax.get('/admin/service_provider/red_packet/send?'+url)
}

//小店-服务费列表
export function shopServiceOrdersUidList(id){
  return ajax.get('/admin/shop/shop_service_orders/'+id+'/list?uid='+id)
}

//小店-升级小店
export function  shopUpGrade(id,data){
  return ajax.post('/admin/shop/'+id+'/upgrade',data)
}

//小店-续费小店
export function  renewVipShopWithId(id,data){
  return ajax.post('/admin/shop/'+id+'/renew_vip_shop',data)
}
